package com.leigang.java.code.design.mode.templateMethod;

/**
 * @author leigang
 * @version 1.0
 * @date 2022/5/4 22:46
 **/
public class Coffee {
    /**
     * 准备工作
     */
    void prepareRecipe(){
        boilWater();
        brewCoffeeGrinds();
        pourInCup();
        addSugarAndMilk();
    }

    /**
     * 煮沸水
     */
    public void boilWater(){
        System.out.println("Boiling water");
    }


    /**
     * 冲泡咖啡
     */
    public void brewCoffeeGrinds(){
        System.out.println("Dripping Coffee through filter");
    }

    /**
     * 倒入杯中
     */
    public void pourInCup(){
        System.out.println("Pouring into cup");
    }

    /**
     * 加糖和牛奶
     */
    public void addSugarAndMilk(){
        System.out.println("Adding Sugar and Milk");
    }

}
